Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Emit owner/repo/commit tags for GraphQL queries#1254

Merged
Swatinem merged 1 commit intomainfrom
swatinem/graphql-tags
Mar 31, 2025
Merged

Emit owner/repo/commit tags for GraphQL queries#1254
Swatinem merged 1 commit intomainfrom
swatinem/graphql-tags

Conversation

@Swatinem
Copy link
Copy Markdown
Contributor

This primarily adds Sentry tags to GraphQL endpoints that resolve any kind of field on Repository.commit, etc. This should make it a lot easier to search for traces related to a specific repo or commit.

@Swatinem Swatinem self-assigned this Mar 28, 2025
@Swatinem Swatinem requested a review from a team as a code owner March 28, 2025 12:17
@seer-by-sentry
Copy link
Copy Markdown
Contributor

✅ Sentry found no issues in your recent changes ✅

Comment on lines +25 to +29
# TODO(swatinem): We should find a way to avoid these combinators:
# The `with_recent_coverage` combinator is quite expensive.
# We only need that in case we want to query these props via graphql:
# `coverageAnalytics.{percentCovered,commitSha,hits,misses,lines}`
# Similarly, `with_oldest_commit_at` is only needed for `oldestCommitAt`.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The query generated by the combinators below is this:
https://codecov.sentry.io/insights/backend/database/spans/span/fbbb13620d0da28b/?project=5215654&statsPeriod=30d
As you can see, it is incredibly complex, and also slow.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to self:
mirumee/ariadne#1116 (comment)
this snippet might help achieve that goal. but by god why that is not part of the standard graphql tooling is beyond me. this looks like fundamental functionality that should just exist out of the box.

This primarily adds Sentry tags to GraphQL endpoints that resolve any kind of field on `Repository.commit`, etc.
This should make it a lot easier to search for traces related to a specific repo or commit.
@Swatinem Swatinem force-pushed the swatinem/graphql-tags branch from 8d03f8d to f5de483 Compare March 28, 2025 13:34
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.33%. Comparing base (6e6d2be) to head (f5de483).
Report is 9 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1254      +/-   ##
==========================================
+ Coverage   96.31%   96.33%   +0.01%     
==========================================
  Files         492      492              
  Lines       16805    16896      +91     
==========================================
+ Hits        16185    16276      +91     
  Misses        620      620              
Flag Coverage Δ
unit 96.33% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codecov-notifications
Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@Swatinem Swatinem added this pull request to the merge queue Mar 31, 2025
Merged via the queue into main with commit f6fcffa Mar 31, 2025
23 of 24 checks passed
@Swatinem Swatinem deleted the swatinem/graphql-tags branch March 31, 2025 14:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants